<?php


namespace Xiaoguai\DesignPattern\DP015;


use Xiaoguai\DesignPattern\DP015\Builder\Builder;

class Director
{
    /**
     * @var AbstractBuilder $builder
     */
    protected $builder;

    public function __construct(AbstractBuilder $builder)
    {
        $this->builder = $builder;
    }

    public function construct(): Product
    {
        $this->builder->buildPartA();
        $this->builder->buildPartB();
        $this->builder->buildPartC();
        return $this->builder->getResult();
    }
}